<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<!-- 引入 layui.css -->
<link rel="stylesheet" href="/hospital_system/layui-v2.6.8/layui/css/layui.css"/>
<!-- 引入 layui.js -->
<script src="/hospital_system/layui-v2.6.8/layui/layui.js"></script>
<style type="text/css">
 
	body {
		background-color: #8ea4f8;
		background-image: url(images/background.jpg);
		background-repeat: no-repeat;
		background-size: cover; //背景图适应屏幕
 
	}
	.login_box {
		width: 420px;
		height: 430px;
		background-color: #fff;
		margin: auto;
		margin-top: 150px;
		border-radius: 5px;
		overflow: hidden;//.title设置margin-top无效，给父元素设置overflow:hidden;
	}
	.title {
		text-align: center;
		font-size: 28px;
		color: #000;
		margin-top: 80px;
		margin-bottom: 10px;
		letter-spacing: 3px;
		font-family: sans-serif;
	}
	.input_box {
		width: 300px;
		height: 30px;
		width: 300px;
		height: 40px;
		padding-left: 10px;
		margin-top: 20px;
		margin-left: 50px;
	}
	.button_box {
		width: 300px;
		height: 35px;
		width: 300px;
		height: 40px;
		margin-top: 15px;
		margin-left: 50px;
		border-radius: 5px;
		background-color: #64a9d9;
		cursor: pointer;
		color: #fff;
	}
	.xz {
		width: 300px;
		height: 35px;
		width: 300px;
		height: 40px;
		margin-top: 10px;
		margin-left: 75px;
		
	}
	.logo_box {
		position: absolute;
		background-color: #fff;
		width: 100px;
		height: 100px;
		border-radius: 100px;
		top: 100px;
		left: 46%;
		border: solid 5px #A68364;
		text-align: center;
	}
	.logo_img {
		margin-top: 20px;
	}
</style>
</head>
<body>
<form class="layui-form" action="">
	<div class="logo_box"><img class="logo_img" src="images/login_logo.png"></div>
	<div class="login_box">
		<h1 class="title">欢迎登录</h1>
		<input class="input_box" type="text" id="tel" placeholder="用户名">
		<input class="input_box" type="password" id="pass" placeholder="密码">
		<div class="layui-form-item">

    <div class="layui-input-block xz" >
      <input type="radio" name="sex" value="1" title="用户登录" checked>
      <input type="radio" name="sex" value="2" title="医生登录" >
      <input type="radio" name="sex" value="3" title="员工登录" >
    </div>
  </div>
		<% if(request.getAttribute("tip")!=null){%>
            	 <br/>
            	<%=request.getAttribute("tip") %>
            
            
           <% } %>
		<input class="button_box" type="button" value="登录" onclick="login()">
	</div>
	</form>
	<script type="text/javascript">
    function login(){
    	//通过名字获取  getElementsByName
        //var obj = document.getElementsByName("fruit");
        //通过标签获取  getElementsByTagName
        var obj = document.getElementsByTagName("input");
            for(var i=0; i<obj.length; i ++){
                if(obj[i].checked){
                   var xz=obj[i].value;
                }
            }
    	var tel=document.getElementById("tel").value;
    	var pass=document.getElementById("pass").value;
    	
    	location.href="/hospital_system/loginController?tel="+tel+"&pass="+pass+"&obj="+xz;
    }
   
    </script>
</body>
</html>
